package com.wei.czz.common.vo.blog;

import com.wei.czz.common.constant.RedisConstant;
import com.wei.czz.common.vo.common.BaseVo;
import lombok.*;

import javax.validation.constraints.NotNull;

/**
 * Created by IntelliJ IDEA.
 *
 * @author wei
 * date: 2021-05-26 13:16:00
 * className: TagSortVo 标签排行页面检索请求Vo类
 * version: 1.0
 * description:
 */
@Getter
@Setter
public class TagSortVo extends BaseVo {

    /**
     * 博客标签名称
     */
    private String tagName;

    /**
     * 是否搜索标签排序列表[有值-搜索 为空-不搜索]
     */
    private String searchTag;

    /**
     * 博客排序类型[0-最新 1-浏览最多 2-点赞最多]
     */
    @NotNull(message = "博客排序类型不能为空")
    private Integer sortType;

    /**
     * 获取标签关联博客列表数据对应的Redis-String缓存键
     */
    public String getTagBlogListKey() {
        return RedisConstant.TAG_BLOG_LIST + RedisConstant.SPLIT + tagName + RedisConstant.SPLIT + sortType
                + RedisConstant.SPLIT + word + RedisConstant.SPLIT + page  + RedisConstant.SPLIT + limit;
    }

}
